package com.example.droideep.fragment;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.View;

import com.example.droideep.R;
import com.example.droideep.common.activities.SimpleFragmentBase;
import com.squareup.timessquare.CalendarPickerView;

import java.util.Calendar;
import java.util.Date;

import butterknife.InjectView;

/**
 * A simple {@link Fragment} subclass.
 */
public class CalendarPickerViewFragment extends SimpleFragmentBase {

    @InjectView(R.id.calendar_picker_view)
    CalendarPickerView calendar;

    public CalendarPickerViewFragment() {
        // Required empty public constructor
    }

    @Override
    protected int getContentResId() {
        return R.layout.fragment_calendar_picker_view;
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        Calendar nextYear = Calendar.getInstance();
        nextYear.add(Calendar.YEAR, 1);

        Date today = new Date();
        calendar.init(today, nextYear.getTime())
                .withSelectedDate(today).inMode(CalendarPickerView.SelectionMode.RANGE);
    }
}
